﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EduseKiosk
{
    public partial class ViewControl : UserControl
    {
        protected string department;
        protected string course;
        protected string chapter;
        protected string section;
        protected string type;
        protected ViewControl upperControl;
        protected ViewControl previousControl;
        protected ViewControl nextControl;
        
        public ViewControl()
        {
            InitializeComponent();
        }

        public void Resize()
        {
            Size = new Size(Size.Width / 2, Size.Height / 2);

            foreach (Control c in Controls)
            {
                c.Location = new Point(c.Location.X / 2, c.Location.Y / 2);
                c.Size = new Size(c.Size.Width / 2, c.Size.Height / 2);
            }
        }

        public string Department
        {
            get { return department; }
            set { department = value; }
        }

        public string Course
        {
            get { return course; }
            set { course = value; }
        }

        public string Chapter
        {
            get { return chapter; }
            set { chapter = value; }
        }

        public string Section
        {
            get { return section; }
            set { section = value; }
        }

        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        public ViewControl UpperControl
        {
            get { return upperControl; }
            set { upperControl = value; }
        }

        public ViewControl PreviousControl
        {
            get { return previousControl; }
            set { previousControl = value; }
        }

        public ViewControl NextControl
        {
            get { return nextControl; }
            set { nextControl = value; }
        }

        protected virtual void ViewControl_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Up)
                MessageBox.Show("Yay");
        }

        public event EventHandler DepartmentClick;
        public event EventHandler CourseClick;
        public event EventHandler ChapterClick;
        public event EventHandler SectionClick;
    }
}
